package com.jams.goodox.entity;

import android.text.TextUtils;

import com.jams.goodox.utils.StringUtils;
import com.jams.goodox.utils.Utils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by jams on 2017/6/23.
 * ***
 * Tel: ***
 * <p>
 * 场地预约
 */

public class ReservationPlaceBean implements Serializable,Mapper<ServeOrderDetailBean> {

    private String address;//	场地地址
    private String adminId;
    private String enterpriseId;
    private String enterpriseName;
    private String houseName;//企业房号
    private String invoiceType;// 1普通 2专用
    private String invoiceName;//发票抬头
    private String isPay;//0未支付 1已支付
    private String mobileNum;//操作人电话
    private String orderId;
    private String orderNum;//	订单序号
    private String orderTime;//下单时间
    private String redPacketId;
    private String redPacketNum;
    private String remark;
    private String status;//	订单状态1.待付款2 已完成3已关闭',
    private String subId;
    private String subPayType;
    private double total;//订单总额
    private double totalMoney;//应付金额
    private String userId;
    private String userName;//操作人姓名
    private String subPhone;//客服电话
    private String placeCover;//场地封面图
    private String placeEquip;//场地设备
    private String placeServerContent;//服务内容
    private String placeId;//场地id
    private ArrayList<Integer> payType;

    public List<MeetSessionItemBean> getScheduleList() {
        return scheduleList;
    }

    public void setScheduleList(List<MeetSessionItemBean> scheduleList) {
        this.scheduleList = scheduleList;
    }

    public String getRedPacketNum() {
        return redPacketNum;
    }

    public void setRedPacketNum(String redPacketNum) {
        this.redPacketNum = redPacketNum;
    }

    private List<MeetSessionItemBean> scheduleList;
    private String waitPayTime;

    public String getWaitPayTime() {
        return waitPayTime;
    }

    public void setWaitPayTime(String waitPayTime) {
        this.waitPayTime = waitPayTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAdminId() {
        return adminId;
    }

    public void setAdminId(String adminId) {
        this.adminId = adminId;
    }

    public String getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(String enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    public String getHouseName() {
        return houseName;
    }

    public void setHouseName(String houseName) {
        this.houseName = houseName;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getInvoiceName() {
        return invoiceName;
    }

    public void setInvoiceName(String invoiceName) {
        this.invoiceName = invoiceName;
    }

    public String getIsPay() {
        return isPay;
    }

    public void setIsPay(String isPay) {
        this.isPay = isPay;
    }

    public String getMobileNum() {
        return mobileNum;
    }

    public void setMobileNum(String mobileNum) {
        this.mobileNum = mobileNum;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    public String getRedPacketId() {
        return redPacketId;
    }

    public void setRedPacketId(String redPacketId) {
        this.redPacketId = redPacketId;
    }

    public String getRemark() {
        if(TextUtils.isEmpty(remark)){
            return "无";
        }
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getStatus() {
        return status==null?"":status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSubId() {
        return subId;
    }

    public void setSubId(String subId) {
        this.subId = subId;
    }

    public String getSubPayType() {
        return subPayType;
    }

    public void setSubPayType(String subPayType) {
        this.subPayType = subPayType;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public double getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(double totalMoney) {
        this.totalMoney = totalMoney;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getSubPhone() {
        return subPhone;
    }

    public void setSubPhone(String subPhone) {
        this.subPhone = subPhone;
    }

    @Override
    public ServeOrderDetailBean transform() {
        ServeOrderDetailBean serveOrderDetailBean=new ServeOrderDetailBean();
        serveOrderDetailBean.setOrderStatus(status);
        serveOrderDetailBean.setOrderNumber(orderNum);
        serveOrderDetailBean.setEmptyPayTime(waitPayTime);
        serveOrderDetailBean.setSubmitOrderTime(orderTime);
        serveOrderDetailBean.setServicePhone(mobileNum);
        serveOrderDetailBean.setChoosePayTypeList(payType);

        ServeOrderDetailBean.CompanyAddressBean companyAddressBean=new ServeOrderDetailBean.CompanyAddressBean();
        companyAddressBean.setCompanyAddress(houseName);
        companyAddressBean.setCompanyName(enterpriseName);
        companyAddressBean.setOperatorName(userName);//此处有疑问
        companyAddressBean.setOperatorPhone(mobileNum);//操作人
        serveOrderDetailBean.setCompanyAddressBean(companyAddressBean);

        serveOrderDetailBean.setTotalMoney(total);
        serveOrderDetailBean.setRealMoney(totalMoney);
        serveOrderDetailBean.setPayType(subPayType);
        serveOrderDetailBean.setIsPay(isPay);
        serveOrderDetailBean.setRedPacketMoney(StringUtils.toDouble(redPacketNum));

        serveOrderDetailBean.setInvoiceType(invoiceType);
        serveOrderDetailBean.setInvoiceHead(invoiceName);

        MeetOrderDetailBean meetOrderDetailBean=new MeetOrderDetailBean();
        meetOrderDetailBean.setScheduleList(scheduleList==null?new ArrayList<MeetSessionItemBean>():scheduleList);
        meetOrderDetailBean.setRemark(TextUtils.isEmpty(remark)?"无":remark);
        meetOrderDetailBean.setMatingList(Utils.getListByString(placeEquip,","));
        meetOrderDetailBean.setMeetPic(placeCover==null?"":placeCover);
        meetOrderDetailBean.setMeetPlaceName(address);
        meetOrderDetailBean.setServiceList(Utils.getListByString(placeServerContent,","));
        meetOrderDetailBean.setPlaceId(placeId);
        serveOrderDetailBean.setServeDetail(meetOrderDetailBean);

        return serveOrderDetailBean;
    }


}
